﻿//===============================================================================
// Microsoft Innovation Centre - Western Europe
// Copyright (c) 2008 Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY
// OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
// FITNESS FOR A PARTICULAR PURPOSE.
//===============================================================================
// The example companies, organizations, products, domain names,
// e-mail addresses, logos, people, places, and events depicted
// herein are fictitious.  No association with any real company,
// organization, product, domain name, email address, logo, person,
// places, or events is intended or should be inferred.
//===============================================================================

using System;
using System.Collections.ObjectModel;
using Microsoft.WVB.Silverlight.Infrastructure;

namespace Microsoft.WVB.Framework.Entities
{
    /// <summary>
    /// The Base class used for all Entities when defined localy.
    /// Use entities defined in the <b>Entities</b> namespace if you want to have control over
    /// the properties and the way it is populated otherwise, generate the EntitiesModel using the 
    /// Datasvcutil.exe to generate a proxy.
    /// </summary>
    public class BaseEntity : BaseItem
    {
        /// <summary>
        /// Public constructor. Initialize a <see cref="BaseEntity"/> object.
        /// </summary>
        public BaseEntity(): base()
        { }

        /// <summary>
        /// A <see cref="String"/> defining the ID found in the Database.
        /// </summary>
        public string ID
        {
            get { return _ID; }
            set { _ID = value; OnPropertyChanged(this.GetPropertySymbol(o=>o.ID)); }
        }
        private string _ID;

        /// <summary>
        /// A <see cref="Collection<T>"/> of <see cref="String"/> defining the internal Categories.
        /// </summary>
        public Collection<string> InternalCategories
        {
            get { return _InternalCategories; }
            set { _InternalCategories = value; OnPropertyChanged(this.GetPropertySymbol(o => o.InternalCategories)); }
        }
        private Collection<string> _InternalCategories = new Collection<string>();

        /// <summary>
        /// An <see cref="Uri"/> pointing to the current entity when accessing the ATOM Data Service.
        /// </summary>
        public Uri Self
        {
            get { return _Self; }
            set { _Self = value; OnPropertyChanged(this.GetPropertySymbol(o => o.Self)); }
        }
        private Uri _Self;

        /// <summary>
        /// The <see cref="Collection<T>"/> of <see cref="Uri"/> pointing to other navigation properties
        /// and their link against the ATOM Data Service.
        /// </summary>
        public Collection<Uri> Related
        {
            get { return _Related; }
            set { _Related = value; OnPropertyChanged(this.GetPropertySymbol(o => o.Related)); }
        }
        private Collection<Uri> _Related = new Collection<Uri>();

        /// <summary>
        /// <seealso cref="Self"/>
        /// </summary>
        public Uri Edit
        {
            get { return _Edit; }
            set { _Edit = value; OnPropertyChanged(this.GetPropertySymbol(o => o.Edit)); }
        }
        private Uri _Edit;
    }
}
